
<!--conf-->
<!-- footer-->
<!-- com-title-->
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
  <link href="../../../lib/weui/weui.css" rel="stylesheet"/>
  <link href="../../scss/main.css" rel="stylesheet"/>
  <script src="../../../lib/weui/weui.js"></script>
  <script src="../../../lib/vue/vue.js"></script>
  <link type="image/x-icon" href="http://on5ngaon4.bkt.clouddn.com/Mountain_64px_1120233_easyicon.net.ico" rel="shortcut icon"/>
  <script src="http://www.jq22.com/jquery/jquery-2.1.1.js"></script>
  <title>网络报修</title>
</head>
<body></body>
<div id="network">
  <div id="head-title">
    <h2>在线报修</h2><a href="index-history.html">历史记录</a>
  </div>
  <div class="weui-cells">
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">姓名</label>
      </div>
      <div class="weui-cell__bd">
        <input name="base" value="钱博康" class="weui-input"/>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd"> 
        <label class="weui-label">宿舍</label>
      </div>
      <div class="weui-cell__bd">
        <input name="base" value="竹枫斋 4舍" readonly="readonly" class="weui-input"/>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">寝室号</label>
      </div>
      <div class="weui-cell__bd">
        <input name="base" value="227" class="weui-input"/>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">手机号</label>
      </div>
      <div class="weui-cell__bd">
        <input name="tel" value="18086407838" class="weui-input"/>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd">
        <label class="weui-label">错误类型</label>
      </div>
      <div class="weui-cell__bd">
        <input name="err" placeholder="选择故障类型（必选）" readonly="readonly" class="weui-input"/>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__bd">
        <textarea name="err" placeholder="请详细描述故障情况（必填）" rows="6" class="weui-textarea"></textarea>
      </div>
    </div>
  </div>
  <div class="weui-btn-area"><a onclick="Info()" class="weui-btn weui-btn_primary">提交</a></div>
  <script>
    var net={ "base":"", "tel":"", "err":"" };
    
    
    function getDorm(){
        weui.picker([
            { label: '桂檀斋'}, 
            { label: '竹枫斋'},
            { label: '椿萱斋'}, 
            { label: '梅菊斋'}
        ], [
            { label: '1舍'}, 
            { label: '2舍'}, 
            { label: '3舍'},
            { label: '4舍'}
        ], {
            onConfirm: function (result) {
       
                var dorm=result[0].label;
                var dorm_num=result[1].label;
    
                var str = dorm +" "+dorm_num;
                base[1].value= str;
            }
        });
    }
    
    function getErr__number(){
        weui.picker([
            { label: '登录提示错误代码651'}, 
            { label: '登录提示错误代码691,629'},
            { label: '登录提示错误代码734'}, 
            { label: '其他错误代码，请在描述里标明'},
            { label: '网速慢，不稳定'},
            { label: '网线接口有问题'}
        ],{
            onConfirm: function (result) {
                err[0].value= result[0].label;
            }
        });
    }        
    
    
    window.onload=function(){
    
        // base 监听事件
        base = document.getElementsByName("base");
        tel = document.getElementsByName("tel");
        err = document.getElementsByName("err");
    
        base[1].onclick=getDorm;
        err[0].onclick=getErr__number;
    
    }
    
    function Info(){
        net.base = base[0].value + " " + base[1].value + " " + base[2].value;
    
        net.tel = tel[0].value;
    
        net.err = err[0].value + err[1].value;
    
        // 是否填充
        if(!(net.base&&net.tel&&net.err)){
            weui.dialog({
                content: "您有未填的内容",
                className: 'custom-classname',
                buttons: [ {
                    label: '确定',
                    type: 'default'
                }]
              });
            }
        else {
            weui.toast('报修成功', 1500);
          }
        }
    
  </script>
  <footer class="weui-footer">
    <div>
      <p><a href="../102.data/index.html" class="weui-footer__link">版本日志</a><a href="../101.message/index.html" class="weui-footer__link">留言反馈</a></p>
    </div>
    <div>
      <p class="ueui-footer__text">Copyright &copy; 2017 信息中心</p>
    </div>
  </footer>
</div>